/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.pp.entites;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author arnaud
 */
@Embeddable
public class EvenementPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "idCreateur")
    private String idCreateur;
    @Basic(optional = false)
    @Column(name = "num_evenement")
    private int numEvenement;

    public EvenementPK() {
    }

    public EvenementPK(String idCreateur, int numEvenement) {
        this.idCreateur = idCreateur;
        this.numEvenement = numEvenement;
    }

    public String getIdCreateur() {
        return idCreateur;
    }

    public void setIdCreateur(String idCreateur) {
        this.idCreateur = idCreateur;
    }

    public int getNumEvenement() {
        return numEvenement;
    }

    public void setNumEvenement(int numEvenement) {
        this.numEvenement = numEvenement;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCreateur != null ? idCreateur.hashCode() : 0);
        hash += (int) numEvenement;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EvenementPK)) {
            return false;
        }
        EvenementPK other = (EvenementPK) object;
        if ((this.idCreateur == null && other.idCreateur != null) || (this.idCreateur != null && !this.idCreateur.equals(other.idCreateur))) {
            return false;
        }
        if (this.numEvenement != other.numEvenement) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.pp.entites.EvenementPK[ idCreateur=" + idCreateur + ", numEvenement=" + numEvenement + " ]";
    }
    
}
